package com.awakensoftware.hunterserver.serverentities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "TreasureTemplates")
public class TreasureTemplate extends ServerEntityBase {

	private static final long serialVersionUID = 5167760943257957476L;

	// Database fields and relationships
	@Id
	@GeneratedValue
	@Column(name = "id")
	private long id;

	@Column(length = 256, unique = false, name = "name")
	private String name;

	@OneToOne
	@JoinColumn(name = "treasure_id", nullable = true)
	private Treasure treasureInstance;

	@Override
	public long getId() {
		return id;
	}

	@Override
	public void setId(long id) {
		this.id = id;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public void setName(String name) {
		this.name = name;
	}

	public Treasure getTreasureInstance() {
		return this.treasureInstance;
	}

	public void setTreasureInstance(Treasure treasure) {
		this.treasureInstance = treasure;
	}

}
